<template>
  <basic-container>
    <!-- 表格 -->
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :defaults.sync="showColumn"
               :permission="permissionList"
               :page.sync="page"
               :before-open="beforeOpen"
               @sortable-change="sortableChange"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @refresh-change="refreshChange"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @filter="filterChange"
               @sort-change="sortChange"
               @row-dblclick="handleRowDBLClick"               
               @on-load="onLoad">
               
      <template slot-scope="scope" slot="belongDeptName">
        <div>
          {{scope.row.belongDeptName}}
        </div> 
      </template>
      <template slot-scope="scope" slot="belongProjectName">
        <div>
          {{scope.row.belongProjectName}}
        </div> 
      </template>
      <template slot-scope="scope" slot="menuForm">
        <div  style="text-align:right; float:right">
          <el-button type="text"  v-if="operateType == 'edit'"   icon="el-icon-time" style="font-weight:normal;" size="large" @click.stop="getHistoryRecord">修改历史</el-button>
        </div> 
      </template>
      <template slot-scope="scope" slot="menuLeft">
        <!-- 批量新增 -->
        <el-button type="primary" size="small" icon="el-icon-plus" v-if="permission.general_staff_station_batch_add" @click.stop="openBatchAddDialog">批量新增</el-button>
        <!-- 删除 -->
        <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.general_staff_station_batch_delete" @click.stop="handleDelete">删 除</el-button>
      </template>
      <template slot="menuRight">
        <!-- 下载 -->
        <el-button v-if="permission.general_staff_station_download" type="default" @click.stop="exportExcel"  title="下载" icon="el-icon-download" circle size="small"></el-button>
      </template>
    </avue-crud>
    <!-- 批量添加数据对话框 -->
    <el-dialog title="批量导入" width='80%' :close-on-click-modal='false' :visible.sync="batchAddDialog">
      <!-- 标题 -->
      <el-tag>ID,租户ID,办公区编号,楼层编号,工位编号,工位性质,工位类型,工位状态,所属项目名称,所属部门名称,使用人名,管理员用户名,工位使用率,出勤状态,联系电话</el-tag>
      <!-- 内容 -->
      <el-input  type="textarea"  :autosize="{ minRows: 10, maxRows: 20}" placeholder="请直接从excel粘贴内容"  v-model="importDataArea"></el-input>
      <div slot="footer" class="dialog-footer">
        <!-- 按钮 --> 
        <el-button size="small" type="primary" id="copyBtn" @click="handleImport($event)" data-clipboard-target="#pathText">开始导入</el-button>
        <el-button size="small" @click="batchAddDialog = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 历史记录 -->
    <update-history ref="historyRecord"></update-history>
  </basic-container>
</template>

<script>
import {exportGeneralStaffStationExcel,saveOrUpdateGeneralStaffStation,saveOrUpdateGeneralStaffStationList,saveGeneralStaffStation,saveGeneralStaffStationList,deleteGeneralStaffStation,queryGeneralStaffStation,queryGeneralStaffStationListPage,updateGeneralStaffStation,deleteGeneralStaffStationList} from '@/api/general/station/generalStaffStationApi';
import {mapGetters} from 'vuex';
import { reqCommonMsg } from '@/util/reqCommonMsg';
import {filterFormat} from '@/util/util';
import {queryGeneralProjectInfoListPage} from '@/api/general/project/generalProjectInfoApi';
import {queryGeneralOrgInfoListPage} from '@/api/general/staff/generalOrgInfoApi';
import { validatenull } from '@/util/validate';
export default {
  data() {
    return {
      //文件选择器的打开方式 add新增、edit修改、view 查看
      openType: 'edit',
      // 当前打开form对话框操作类型 
      operateType: 'add',
      
      //修改记录对话框
      historyDialog: false,
      //如果做流程表单 请将次开关设置为true，否则设置为false
      isFlow: true,
      flowArea: {},
      
      importDataArea: '',
      batchAddDialog: false,
      form: {},
      currentRow: {},
      selectionList: [],
      loading: true, 
      showColumn: [],
      depList:[],
      option: {
        labelPosition: 'right',
        labelSuffix: '：',
        labelWidth: 125,
        dialogTop: '50',
        indexFixed:true, 
        stripe:true,
        calcHeight: 80,
        searchShow: true,
        searchMenuSpan: 6,
        tip: false,
        border: true,
        index: true,
        selection: true,
        addBtn: true,
        align:'center',
        viewBtn: true,
        delBtn: true,
        cancelBtn: true,
        printBtn:false,
        saveBtn: true,
        filterBtn:true,          
        menuWidth: 200,
        dialogMenuPosition: 'center',
        dialogDirection:'rtl',
        dialogType:'dialog',
        dialogFullscreen:false,
        dialogClickModal:false,
        dialogWidth: '70%',
        highlightCurrentRow:  true,
        searchShow:true,
        column: [
          // 办公区编号
          {
            label: '办公区',
            prop: 'officeAreaName', 
            type: 'select', 
            search: true,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            filterable: true,
            sortable: false,
            hide: false,
            maxlength: 30,
            overHidden: true,
            rules: [{
              message: '请输入办公区编号',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          // 楼层编号
          {
            label: '楼层号',
            prop: 'floorNo', 
            type: 'select', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            filterable: true,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 30,
            overHidden: true,
            value: '1',
            rules: [{
              message: '请选择楼层号',
              required:  true,
              trigger: 'blur'
            }],
            dicData:[],
          },
          // 工位编号
          {
            label: '工位编号',
            prop: 'staffStationNo', 
            type: 'input', 
            search: true,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 30,
            overHidden: true,
            rules: [{
              message: '请输入工位编号',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          // 工位性质
          {
            label: '工位性质',
            prop: 'staffStationProperties', 
            type: 'select', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 30,
            overHidden: true,
            rules: [{
              message: '请输入工位性质',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          // 工位类型
          {
            label: '工位类型',
            prop: 'staffStationType', 
            type: 'select', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 30,
            overHidden: true,
            rules: [{
              message: '请输入工位类型',
              required:  true,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          // 工位状态
          {
            label: '工位状态',
            prop: 'status', 
            type: 'select', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 30,
            overHidden: true,
            rules: [{
              message: '请输入状态',
              required:  false,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[
              {
                label: '正常',
                value: '1'
              },{
                label: '空闲',
                value: '2'
              }
            ],
          },
          // 所属项目名称
          {
            label: '所属项目名称',
            prop: 'belongProjectName',
            type: 'table',
            index:true,
            slot:true,
            width:150,
            children: {
              border: true,
              column: [{
                label: '项目编号',
                search:true,
                searchSpan:6,
                prop: 'projectNo'
              }, {
                label: '项目名称',
                prop: 'projectName',
                search:true,
                searchSpan:6,
              }],
            },
            formatter: (row) => {
              if(!row.projectName) return ''
              return row.projectName
            },
            onLoad: ({ page, value,data }, callback) => {
              //首次加载去查询对应的值
              if (value) {
                let params = {
                  singleBody: {projectName:value},
                  currentPage: 1,
                  pageSize: 10
                }
                queryGeneralProjectInfoListPage(reqCommonMsg(params)).then(res => {
                  backdata = res.data.body.listBody.map((item,index)=>{
                    return {id:index,projectName:item.projectName,projectNo:item.projectNo}
                  });
                  callback(backdata[0])
                  return
                });
                return
              }
              // 进入加载列表
              let backdata =[];
              let params = {
                singleBody: data,
                currentPage: page?page.currentPage:1,
                pageSize: page?page.pageSize:10
              }
              queryGeneralProjectInfoListPage(reqCommonMsg(params)).then(res => {
                backdata = res.data.body.listBody.map((item,index)=>{
                  return {id:index,projectName:item.projectName,projectNo:item.projectNo}
                });
                //分页查询信息
                callback({
                  total: res.data.body.total,
                  data: backdata
                })
              }, error => {
                callback({
                  total: 0,
                  data: []
                })
              });
            },
            props: {
              label: 'projectName',
              value: 'projectName'
            },
            rules: [
              {
                required: false,
                message: '请选择所属项目名称',
                trigger: 'blur'
              }
            ]
          },
          // 所属部门名称
          {
            label: '所属部门名称',
            prop: 'belongDeptName',
            type: 'table',
            slot: true,
            width:150,
            children: {
              border: true,
              column: [{
                label: '部门编号',
                search:true,
                searchSpan:6,
                prop: 'orgNo'
              }, {
                label: '部门名称',
                prop: 'orgName',
                search:true,
                searchSpan:6,
              }],
            },
            formatter: (row) => {
              if(!row.orgName) return ''
              return row.orgName
            },
            onLoad: ({ page, value,data }, callback) => {
              //首次加载去查询对应的值
              if (value) {
                let params = {
                  singleBody: {orgName:value},
                  currentPage: 1,
                  pageSize: 10
                }
                queryGeneralOrgInfoListPage(reqCommonMsg(params)).then(res => {
                  backdata = res.data.body.listBody.map((item,index)=>{
                    return {id:index,orgName:item.orgName,orgNo:item.orgNo}
                  });
                  callback(backdata[0])
                  return
                });
                return
              }
              let backdata =[];
              let params = {
                singleBody: data,
                currentPage: page?page.currentPage:1,
                pageSize: page?page.pageSize:10
              }
              queryGeneralOrgInfoListPage(reqCommonMsg(params)).then(res => {
                backdata = res.data.body.listBody.map((item,index)=>{
                  return {id:index,orgName:item.orgName,orgNo:item.orgNo}
                });
                //分页查询信息
                callback({
                  total: res.data.body.total,
                  data: backdata
                })
              }, error => {
                callback({
                  total: 0,
                  data: []
                })
              });
            },
            props: {
              label: 'orgName',
              value: 'orgName'
            },
            rules: [
              {
                required: false,
                message: '请选择所属部门名称',
                trigger: 'blur'
              }
            ]
          },
          // 使用人名
          {
            label: '使用人名',
            prop: 'useRealName', 
            type: 'select',
            width:120,
            props: {
              label: 'realName',
              value: 'realName'
            },
            dicData:[],
            remote: true,
            dicMethod:'get',
            dicUrl: '/platform/sysUserInfo/querySysUserInfoListPage?optFlag=noorg&columnValue={{key}}&columnName=realName&tenantId='+localStorage.getItem('tenantId'),
            rules: [{
              required:  false,
              message: '请输入使用人名',
              trigger: 'blur'
            }],
          },
          // 管理员用户名
          {
            label: '管理员用户名',
            prop: 'managerRealName', 
            type: 'select',
            hide:true,
            props: {
              label: 'realName',
              value: 'realName'
            },
            dicData:[],
            remote: true,
            dicMethod:'get',
            dicUrl: '/platform/sysUserInfo/querySysUserInfoListPage?optFlag=noorg&columnValue={{key}}&columnName=realName&tenantId='+localStorage.getItem('tenantId'),
            rules: [{
              required:  false,
              message: '请输入管理员用户名',
              trigger: 'blur'
            }],
          },
          // 30日工位使用率
          {
            label: '工位使用率',
            prop: 'useStatusList', 
            type: 'input', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: true,
            maxlength: 2000,
            overHidden: true,
            disabled: false,
            rules: [{
              message: '请输入使用状态列表',
              required:  false,
              trigger: 'blur'
            },
            {
              max: 2000,
              message: '内容长度不能超过2000字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
          // 出勤状态
          {
            label: '出勤状态',
            prop: 'attendanceStatus', 
            type: 'select', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 30,
            overHidden: true,
            disabled:false,
            dicData:[],
          },
          // 联系电话
          {
            label: '联系电话',
            prop: 'contactPhoneNo', 
            type: 'input', 
            search: false,
            searchMmultiple: false,
            searchLabelWidth: 100,
            multiple: false,
            span: 12,
            sortable: false,
            hide: false,
            maxlength: 30,
            width:150,
            overHidden: true,
            rules: [{
           	  // 检查电话号码
              validator: (rule, value, callback) => {
                if(value != '' && !this.$validate.isPhone(value)){
                  callback(new Error('请输入有效的电话号码！'));
                }
                else{
                  callback();
                }
              },
              required:  false,
              trigger: 'blur'
            },
            {
              max: 30,
              message: '内容长度不能超过30字符',
              trigger: 'blur'
            }],
            dicData:[],
          },
        ]
      },
      data: [],
      // 请求参数区
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      reqParams: {
        singleBody: {},
        listBody: [{}],
        sqlCondition:[],
        orderRule: [],
        currentPage: 1,
        pageSize: 10
      },
      commonData: null,
      conditions: [],
      orderRules: [],
      singleBody: {}
    };
  },
  computed: {
    ...mapGetters(['website','orgTree','genOrgTree','userInfo','permission','projectInfo']),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.general_staff_station_add, false),
        viewBtn: this.vaildData(this.permission.general_staff_station_view, false),
        delBtn: this.vaildData(this.permission.general_staff_station_delete, false),
        editBtn: this.vaildData(this.permission.general_staff_station_edit, false),
        printBtn: this.vaildData(this.permission.general_staff_station_print, false),
        searchBtn:this.vaildData(this.permission.general_staff_station_search, false)
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
        ids.push({id : ele.id});
      });
      return ids;
    } 
  },
  methods: {
    /**
     * 加载列表数据
     */
    onLoad(page) {
   	  //如果和项目相关，请打开项目ID作为查询条件
      //if(!this.$project.checkChooseProject()){
      //  return false;
      //}
      //this.singleBody.projectId = this.projectInfo.id;
      this.loading = true;
      let params =  {
        singleBody: this.singleBody,
        listBody: [{}],
        sqlCondition: this.conditions,
        orderRule: this.orderRules,
        currentPage: page.currentPage, 
        pageSize: page.pageSize
      }
      queryGeneralStaffStationListPage(reqCommonMsg(params)).then(res => {
        const data = res.data.body;
        this.page.total = data.total;
        this.data = data.listBody;
        this.loading = false;
        this.selectionClear();
      }, error => {
        this.loading = false; 
      });
    },
    /**
     * 双击打开详细窗口
     */
    handleRowDBLClick (row, event) {
      if(this.permission.general_staff_station_dbclick){
        this.$refs.crud.rowView(row,row.$index);
      }
    },
    /**
     * 搜索重置
     */
    searchReset() {
      this.conditions =[];
      this.singleBody = {};
      this.onLoad(this.page);
    },
    /**
     * 搜索
     */
    searchChange(params, done) {
      //this.$console.log(params,'params');
      this.singleBody = params
      this.page.currentPage = 1;
      this.onLoad(this.page);
      done();
    },
    /**
     * 重置刷新
     */
    refreshChange(){
      this.onLoad(this.page);
    },
    /**
     * 复选框事件
     */
    selectionChange(list) {
      this.selectionList = list;
    },
    /**
     * 清除复选框
     */
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    /**
     * 翻页查询
     */
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    /**
     * 更改每页条数
     */
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    /**
     * 自定义查询条件
     */
    filterChange(result) {
      this.page.currentPage = 1;
      this.conditions = filterFormat(result)
      this.onLoad(this.page);
    },
    /**
     * 列表排序
     */
    sortChange(val){
      this.orderRules=val
      this.onLoad(this.page);
    },
    /**
     * 导出Excel
     */
    exportExcel() {
      let params =  {
        singleBody: this.singleBody,
        listBody: [{}],
        sqlCondition: this.conditions,
        orderRule: this.orderRules,
        currentPage:1, 
        pageSize: 100
      }
      exportGeneralStaffStationExcel(reqCommonMsg(params));
    },
    /**
     * 处理批量删除
     */
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning('请选择至少一条数据');
        return;
      }
      this.$confirm('确定将选择数据删除?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          return deleteGeneralStaffStationList(reqCommonMsg({listBody:this.ids}));
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
          this.$refs.crud.toggleSelection();
        }).catch(() => {});
    },
    /**
     * 批量新增记录
     */
    openBatchAddDialog(){
      this.batchAddDialog = true;
    },
    /**
     * 调用子组件方法查询历史
     */
    getHistoryRecord () {
      setTimeout(() => {
        this.$refs.historyRecord.getUpdateHistoryRecord(this.form.id);
      })
    },
    /**
     * ===============================================
     * 自定义
     */
    /**
     * 编辑
     */  
    beforeOpen(done, type) {
      if (['edit', 'view'].includes(type)) {
        this.operateType = 'edit';
        const loading = this.$loading({
          lock: true,
          text: 'Loading',
          spinner: 'el-icon-loading'
        });
        queryGeneralStaffStation(reqCommonMsg( {singleBody: {id:this.form.id}})).then(res => {
          let form = res.data.body.singleBody;
          // 使用人名,管理员用户名显示拼接
          form.useRealName = form.useRealName + (form.useUserName?'('+ form.useUserName +')':'');
          form.managerRealName = form.managerRealName + (form.managerUserName?'('+ form.managerUserName +')':'');
          this.form = form;
          loading.close();
          done();
        }, error => {
          loading.close();
          done();
        });
      }
      if (['add'].includes(type)) {
        this.operateType = 'add';
        done();
      }
    },
    /**
     * 新增一条记录
     */
    rowSave(row, done, loading) {
      let params ={
        singleBody:{
          ...row,
          useRealName:this.$util.formatUserName(row.useRealName).userName,// 使用人名
          useUserName:this.$util.formatUserName(row.useRealName).userId,// 使用用户名
          managerRealName:this.$util.formatUserName(row.managerRealName).userName,// 管理员用户名
          managerUserName:this.$util.formatUserName(row.managerRealName).userId,// 管理员人名
        },
        currentPage: 0,
        pageSize: 0
      };
      saveGeneralStaffStation(reqCommonMsg(params)).then(() => {
        done();
        this.onLoad(this.page);
        this.$message({type: 'success', message: '操作成功!'});
      }, error => {
        done();
      });
    },
    /**
     * 修改一条记录
     */
    rowUpdate(row, index, done, loading) {
      let params ={
        singleBody:{
          ...row,
          useRealName:this.$util.formatUserName(row.useRealName).userName,// 使用人名
          useUserName:this.$util.formatUserName(row.useRealName).userId,// 使用用户名
          managerRealName:this.$util.formatUserName(row.managerRealName).userName,// 管理员用户名
          managerUserName:this.$util.formatUserName(row.managerRealName).userId,// 管理员人名
        },
        currentPage: 0,
        pageSize: 0
      };
      updateGeneralStaffStation(reqCommonMsg(params)).then(() => {
        done();
        this.onLoad(this.page);
        this.$message({type: 'success',message: '操作成功!'});
      }, error => {
        done();
      });
    },
    /**
     * 删除一条记录
     */
    rowDel(row) {
      this.$confirm('确定将选择数据删除?', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'})
        .then(() => {
          return deleteGeneralStaffStation(reqCommonMsg({singleBody:row}));
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({type: 'success',message: '操作成功!'});
        }).catch(() => {});
    },
    /**
     * 批量导入
     */
    handleImport() {
      const loading = this.$loading({
        lock: true,
        text: '处理中...',
        spinner: 'el-icon-loading',
      });
      var dataList = new Array();
      if(this.importDataArea){
        var lineList = this.importDataArea.split('\n')
        lineList.forEach((element,index) => {
          if(element.trim() != ''){
            var field = element.split('\t')
            // var fieldList = {
            //   id:field[0].trim(),
            //   tenantId:field[1].trim(),
            //   officeAreaNo:field[2].trim(),
            //   floorNo:field[3].trim(),
            //   staffStationNo:field[4].trim(),
            //   staffStationProperties:field[5].trim(),
            //   staffStationType:field[6].trim(),
            //   belongProjectNo:field[7].trim(),
            //   belongProjectName:field[8].trim(),
            //   belongDeptNo:field[9].trim(),
            //   belongDeptName:field[10].trim(),
            //   useUserName:field[11].trim(),
            //   useRealName:field[12].trim(),
            //   useStatusList:field[13].trim(),
            //   managerUserName:field[14].trim(),
            //   managerRealName:field[15].trim(),
            //   contactPhoneNo:field[16].trim(),
            //   status:field[17].trim(),
            // }
            let fieldList = {
              id:field[0].trim(),
              tenantId:field[1].trim(),
            };
            this.option.column.forEach((item,index)=>{
              fieldList1[item.prop] = field[index + 2].trim();
            });
            dataList[index] = fieldList
          }
        });
        //批量写入记录
        saveGeneralStaffStationList(reqCommonMsg({listBody:dataList})).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
          loading.close();
        }, error => {
          loading.close();
        });      
      }
      else{
        this.loading=false;
        this.$message({
          type: 'warning',
          message: '数据格式不正确!'
        });
      }
    },
    /**
     * 获取业务字典参数
     */
    async getBizDict() {
      let dicData = await this.$params.getBizDict('["staffStationProperties","staffStationType","attendanceStatus","officeAreaName","floorNo"]');
      this.findObject(this.option.column, 'staffStationProperties').dicData = dicData.staffStationProperties;
      this.findObject(this.option.column, 'staffStationType').dicData = dicData.staffStationType;
      this.findObject(this.option.column, 'attendanceStatus').dicData = dicData.attendanceStatus;
      this.findObject(this.option.column, 'officeAreaName').dicData = dicData.officeAreaName;
      this.findObject(this.option.column, 'floorNo').dicData = dicData.floorNo;
    },
  },
  created() {
    this.showColumn = this.$getStore({name: this.userInfo.userId +'generalStaffStationColumn'});
    //获取业务字典
    this.getBizDict();
  },
  watch: {
    showColumn: {
      handler(newValue, oldValue) {
        this.$setStore({name:  this.userInfo.userId+'generalStaffStationColumn', content: this.showColumn});
      },
      deep: true
      //this.$setStore({name: this.userInfo.userId +'generalStaffStationColumn', content: this.showColumn});
    }
  }
};
</script>
